<?php
/**
 * @Author: hpp
 * @Date:   2018-11-21 15:49:10
 * @Last Modified by:   hpp
 * @Last Modified time: 2018-11-22 17:31:41
 */
namespace app\admin\validate;

use think\Validate;

class Meun extends Validate
{
	protected $rule = [
        'name'  =>  'require|unique:menu',
        'permission_key' => 'require|unique:menu',
        'url' => 'require'
    ];
    protected $message = [
        'name.require'  =>  '菜单名字必须填写',
        'name.unique'  => '菜单名字已存在',
        'permission_key.require' => '菜单标识必须填写',
        'permission_key.unique' => '菜单标识已存在',
        'url.require' => 'url地址必须填写'
    ];
    protected $scene = [
        'edit' => ['name.require','permission_key.require','url'],
        'add' => ['name','permission_key','url']
    ];
}